import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nft_shop/widgets/image.dart';
import 'package:nft_shop/widgets/my_scroll_view.dart';

class MyCheckWorkWidget extends StatelessWidget {
  String url;

  MyCheckWorkWidget(this.url);

  @override
  Widget build(BuildContext context) {
    print("加载的地址是---${url}");
    final Widget content = Material(
        color: Colors.transparent,
        child: ExtendedImage.network(
          url,
          fit: BoxFit.contain,
          //enableLoadState: false,
          mode: ExtendedImageMode.gesture,
          initGestureConfigHandler: (state) {
            return GestureConfig(
                minScale: 0.9,
                animationMinScale: 0.7,
                maxScale: 3.0,
                animationMaxScale: 3.5,
                speed: 1.0,
                inertialSpeed: 100.0,
                initialScale: 1.0,
                inPageView: false);
          },
        )
        // Column(
        //   mainAxisSize: MainAxisSize.min,
        //   children: [
        //     WrapperImage(url: url, width: Get.width - 50, height: Get.height-50,fit: BoxFit.contain,),
        //     SizedBox(height: 13,),
        //   ],
        // )
        );

    final Widget body = MediaQuery.removeViewInsets(
      removeLeft: true,
      removeTop: true,
      removeRight: true,
      removeBottom: true,
      context: context,
      child: Center(
        child: InkWell(
          onTap: () {
            Get.back();
          },
          child: SizedBox(
            width: Get.width - 50,
            height: 508,
            child: content,
          ),
        ),
      ),
    );

    return AnimatedPadding(
      padding: MediaQuery.of(context).viewInsets,
      duration: const Duration(milliseconds: 120),
      curve: Curves.easeInCubic, // easeOutQuad
      child: body,
    );
  }
}
